import echarts from 'echarts'

const echartsUtils = {
    drawMap: function(extent, echarts3Layer, result){
        debugger
        let name = 'mymap';
        echarts.registerMap(name, result);
        echarts3Layer.setOption({
            backgroundColor: '#99404a59',
            title: {
                text: name,
                left: 'center',
                textStyle: {
                    color: '#fff'
                }
            },
            series:[{
                type: 'map',
                map: name,
                // roam: true,
                // silent: true,
                aspectScale: 1,
                left: 0, top: 0, right: 0, bottom: 0,
                boundingCoords: [[extent.xmin,extent.ymax],[extent.xmax,extent.ymin]],
                // scaleLimit: {
                //     min: 0.0001,
                //     max: 10000
                // },
                label: {
                    emphasis: {
                        textStyle: {
                            color: '#fff'
                        }
                    }
                },
                itemStyle: {
                    normal: {
                        borderColor: '#389BB7',
                        areaColor: '#fff000',
                    },
                    emphasis: {
                        areaColor: '#389BB7',
                        borderWidth: 0
                    }
                },
                animation: false
            }]
        })
    }
}

export default echartsUtils